package com.coze.lg.cozeagent.config;

import com.coze.openapi.service.auth.TokenAuth;
import com.coze.openapi.service.config.Consts;
import com.coze.openapi.service.service.CozeAPI;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

@Component
@Data
public class CozeConfig {
    private String token = "pat_TSq5A1lu2yfpwebcgosDWjwTBVfrQ0UW17F0TovgE7wzuT88bAn6q6eiVOG1QK1Q";
    private String baseURL = Consts.COZE_CN_BASE_URL;
    private int readTimeout = 10000;
    @Bean
    public TokenAuth tokenAuth() {
        return new TokenAuth(this.token);
    }

    @Bean
    public CozeAPI cozeAPI() {
        return new CozeAPI.Builder()
                .baseURL(this.baseURL)
                .auth(new TokenAuth(this.token))
                .readTimeout(this.readTimeout)
                .build();
    }
}
